package linshuai;

import javafx.application.Application;
import javafx.application.Platform;
import javafx.scene.Scene;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.stage.Stage;

public class LinShuai extends Application
{
    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage stage) {
		Scene scene = new Scene(new UI(stage));
		scene.addEventHandler(KeyEvent.KEY_PRESSED, ev -> {
			if(ev.getCode() == KeyCode.ESCAPE)
				System.exit(0);
		});
		stage.setOnCloseRequest(ev -> {
			Platform.exit();
			System.exit(0);
		});
		stage.setTitle("LinShuai");
		stage.setResizable(false);
		stage.setScene(scene);
		stage.sizeToScene();
		stage.show();
	}
}
